Then you can post questions in General Programming Forum...
Qt Code:
class LogClass { public: QString textString; }; { return textString; } function() { LogClass log; // Both does the same }To copy to clipboard, switch view to plain text mode
Then you can post questions in General Programming Forum...
Qt Code:
class LogClass { public: QString textString; }; { return textString; } function() { LogClass log; // Both does the same }To copy to clipboard, switch view to plain text mode
thnks, i was try this but i have a error in the compilation, i did this:
Qt Code:
MainWindow.cpp #include "LogClass.h" log login; QString showme; showme=login.cuenta; ui->mostrarcuenta->setText(showtime);To copy to clipboard, switch view to plain text mode
the error its this:
login was not declarate in this scope
thnks
show the log class definition, also I guess there should be more errors, post them too
ok, this its:
Qt Code:
#ifndef LOG_H #define LOG_H #include <QMainWindow> #include <QWidget> #include "mainwindow.h" #include <QSqlQuery> #include <QKeyEvent> namespace Ui { class log; } { Q_OBJECT public: QString cuenta; ~log(); private: Ui::log *ui; MainWindow m; private slots: // void funcion::keyPressEvent( QKeyEvent* ); void on_pushButton_clicked(); }; #endif // LOG_HTo copy to clipboard, switch view to plain text mode
then, i call the Qstring cuenta so:
this code is located in mainwindow.cpp
Qt Code:
log login; QString showme; showme= login.cuenta;To copy to clipboard, switch view to plain text mode
the compiler does not show other error
first point, don't use a standard name like log (it can conflict with log() function in math.h), use a different class name.
next the error might related to Ui::log class, not ::log class (note the scope), try including "ui_log.h" (or whatever is the ui file name is) in mainwindow.cpp
Bookmarks